<template>
  <div>
    <MsgAdd ref="add"></MsgAdd>
    <MsgDetail ref="detail"></MsgDetail>
    <MsgRead ref="read"></MsgRead>
    <a-row class="mb10">
      <a-col span="12">
        <a-button type="primary" @click="toAdd()" class="mr10"><i class="fa fa-plus mr4"/>发消息</a-button>
        <a-button type="" @click="del()"><i class="fa fa-trash mr4"/>删除</a-button>
      </a-col>
      <a-col span="12" class="tar">
        <a-input class="w200 mr10" placeholder="消息标题" v-model.trim="searchStr"></a-input>
        <a-select class="w80 mr10" placeholder="状态" v-model="state">
          <a-select-option :key="0">不限</a-select-option>
          <a-select-option :key="1">草稿</a-select-option>
          <a-select-option :key="2">已发送</a-select-option>
        </a-select>
        <a-button type="" @click="search()"><i class="fa fa-search mr4"/>查询</a-button>
      </a-col>
    </a-row>
    <table class="table">
      <tr class="head">
        <td class="w40"><a-checkbox></a-checkbox></td>
        <td>状态</td>
        <td>标题</td>
        <td>接收人</td>
        <td class="w200">发布时间</td>
        <td class="w120">阅读情况</td>
      </tr>
      <tr v-for="i in 10" :key="i">
        <td><a-checkbox></a-checkbox></td>
        <td>草稿</td>
        <td style="padding-left:10px;text-align:left"><a @click="toDetail()">这里是消息标题这里是消息标题这里是消息标题</a></td>
        <td>张三，李四，王五等10人</td>
        <td>2021年2月11日 12时30分</td>
        <td><a @click="toRead()">5/10 已读</a></td>
      </tr>
    </table>
    <Page></Page>
  </div>
</template>
<script>
import { pageMixin } from '@/core/page-mixin'
import MsgAdd from './Add'
import MsgDetail from './Detail'
import MsgRead from './Read'
export default {
  mixins: [pageMixin],
  components: {
    MsgAdd, MsgDetail, MsgRead
  },
  data () {
    return {
      state: 0
    }
  },
  methods: {
    toAdd () {
      this.$refs.add.open()
    },
    toDetail () {
      this.$refs.detail.open()
    },
    toRead () {
      this.$refs.read.open()
    },
    handleOk () {}
  }
}
</script>
